/*
Arm Tracker and Glove Demo by Noah Zerkin (noazark AT gmail.com) 2009
Released under GNU GPLv3.0 http://www.opensource.org/licenses/gpl-3.0.html
*/

void fingerMap(int s){
  thumb[s][0] = (int)map(thumb[s][9], thumb[s][3], thumb[s][6], 0, 40);
  thumb[s][1] = (int)map(thumb[s][10], thumb[s][4], thumb[s][7], 0, 40);
  thumb[s][2] = (int)map(thumb[s][11], thumb[s][5], thumb[s][8], 0, 40);
  fingerIndex[s][0] = (int)map(fingerIndex[s][6], fingerIndex[s][4], fingerIndex[s][2], 0, 40);
  fingerIndex[s][1] = (int)map(fingerIndex[s][7], fingerIndex[s][5], fingerIndex[s][3], 0, 90);
  fingerMiddle[s][0] = (int)map(fingerMiddle[s][6], fingerMiddle[s][4], fingerMiddle[s][2], 0, 40);
  fingerMiddle[s][1] = (int)map(fingerMiddle[s][7], fingerMiddle[s][5], fingerMiddle[s][3], 0, 90);
  fingerRing[s][0] = (int)map(fingerRing[s][6], fingerRing[s][4], fingerRing[s][2], 0, 40);
  fingerRing[s][1] = (int)map(fingerRing[s][7], fingerRing[s][5], fingerRing[s][3], 0, 90);
  fingerPinky[s][0] = (int)map(fingerPinky[s][6], fingerPinky[s][4], fingerPinky[s][2], 0, 40);
  fingerPinky[s][1] = (int)map(fingerPinky[s][7], fingerPinky[s][5], fingerPinky[s][3], 0, 90);
  wrist[s][0] = (int)map(wrist[s][6], wrist[s][4], wrist[s][2], -80, 10);
  wrist[s][1] = (int)map(wrist[s][7], wrist[s][5], wrist[s][3], -45, 180);
}
